package com.huaxin.hxcloud.work;

import android.app.Activity;
import android.content.Context;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.huaxin.common.Entity.RepairRecord;
import com.huaxin.hxcloud.R;

import java.util.List;

/**
 * Created by Administrator on 2016/12/29.
 * 首创维修记录adapter
 */

public class HxScRepairRecordAdapter extends BaseQuickAdapter<RepairRecord, BaseViewHolder> {
    private HxScRepairRecordActivity mActivity;
    private Context  mContext;
    private HxScTwoRepairRecordAdapter mTwoRepairRecordAdapter;

    public HxScRepairRecordAdapter(HxScRepairRecordActivity activity) {
        super(R.layout.item_repair_record);
        this.mActivity = activity;
        this.mContext = activity;
    }

    @Override
    protected void convert(BaseViewHolder helper, RepairRecord item) {
        RecyclerView recyclerView= helper.getView(R.id.ls_img);
        recyclerView.setLayoutManager(new LinearLayoutManager(mContext));
        mTwoRepairRecordAdapter = new HxScTwoRepairRecordAdapter(mActivity);
        mTwoRepairRecordAdapter.setNewData(item.getImages());
        recyclerView.setAdapter(mTwoRepairRecordAdapter);

    }
}